package com.ycj.design.create.singleton;

/**
 * 饿汉式（静态代码块）
 * 优缺点与one一样
 * @author chuanjieyang
 * @date Nov 20, 2018 11:26:29 AM
 */
public class SingletonPatternTwo {
    private static SingletonPatternTwo instance;

    static {
        instance = new SingletonPatternTwo();
    }

    private SingletonPatternTwo(){}
    
    public static SingletonPatternTwo getInstance(){
        return instance;
    }
}
